Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ

Node / meshtastic / Meshtastic-Android / files / .github / workflows / models_pr_triage.yml

Displaying Raw β€’ Download

.github/workflows/models_pr_triage.yml gh-readonly-queue/main/pr-5954-e8fb0d3632384411e1ab015c806a2ae3631fcc42 (3b09b6ac) Text, 8.99 KB

Tff7b72nameTb4b4b4: Ta5d6ffPRTa5d6ff Ta5d6ffTriageTa5d6ff Ta5d6ff(Models)

Tff7b72onTb4b4b4:
Tff7b72workflow_dispatchTb4b4b4:

Tff7b72permissionsTb4b4b4:
Tff7b72pull-requestsTb4b4b4: Ta5d6ffwrite
Tff7b72issuesTb4b4b4: Ta5d6ffwrite
Tff7b72modelsTb4b4b4: Ta5d6ffread

Tff7b72concurrencyTb4b4b4:
Tff7b72groupTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.workflowTa5d6ff Ta5d6ff}}-${{Ta5d6ff Ta5d6ffgithub.event.pull_request.numberTa5d6ff Ta5d6ff}}
Tff7b72cancel-in-progressTb4b4b4: Ta5d6fftrue

Tff7b72jobsTb4b4b4:
Tff7b72triageTb4b4b4:
Tff7b72ifTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.repositoryTa5d6ff Ta5d6ff==Ta5d6ff Ta5d6ff'meshtastic/Meshtastic-Android'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ffgithub.event.pull_request.user.typeTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'Bot'Ta5d6ff Ta5d6ff}}
Tff7b72runs-onTb4b4b4: Ta5d6ffubuntu-24.04-arm
Tff7b72stepsTb4b4b4:
T8b949e# ─────────────────────────────────────────────────────────────────────────
T8b949e# Step 1: Check if PR already has automation/type labels (skip if so)
T8b949e# ─────────────────────────────────────────────────────────────────────────
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffCheckTa5d6ff Ta5d6ffexistingTa5d6ff Ta5d6fflabels
Tff7b72usesTb4b4b4: Ta5d6ffactions/github-script@v9
Tff7b72idTb4b4b4: Ta5d6ffcheck-labels
Tff7b72withTb4b4b4:
Tff7b72scriptTb4b4b4: Tb4b4b4|
Tff7b72const skipLabels = new Set(['automation', 'release']);
Tff7b72const typeLabels = new Set(['bugfix', 'enhancement', 'dependencies', 'repo', 'refactor', 'chore', 'ci', 'build', 'testing', 'documentation']);
Tff7b72const prLabels = context.payload.pull_request.labels.map(l => l.name);

Tff7b72const shouldSkipAll = prLabels.some(l => skipLabels.has(l));
Tff7b72const hasTypeLabel = prLabels.some(l => typeLabels.has(l));

Tff7b72core.setOutput('skip_all', shouldSkipAll ? 'true' : 'false');
Tff7b72core.setOutput('has_type_label', hasTypeLabel ? 'true' : 'false');

T8b949e# ─────────────────────────────────────────────────────────────────────────
T8b949e# Step 2: Quality check (spam/AI-slop detection)
T8b949e# ─────────────────────────────────────────────────────────────────────────
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffDetectTa5d6ff Ta5d6ffspamTa5d6ff Ta5d6fforTa5d6ff Ta5d6fflow-qualityTa5d6ff Ta5d6ffcontent
Tff7b72ifTb4b4b4: Ta5d6ffsteps.check-labels.outputs.skip_allTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'true'
Tff7b72usesTb4b4b4: Ta5d6ffactions/ai-inference@v2
Tff7b72idTb4b4b4: Ta5d6ffquality
Tff7b72continue-on-errorTb4b4b4: Ta5d6fftrue
Tff7b72envTb4b4b4:
Tff7b72PR_TITLETb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.event.pull_request.titleTa5d6ff Ta5d6ff}}
Tff7b72PR_BODYTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.event.pull_request.bodyTa5d6ff Ta5d6ff}}
Tff7b72withTb4b4b4:
Tff7b72max-tokensTb4b4b4: Ta5d6ff20
Tff7b72promptTb4b4b4: Tb4b4b4|
Tff7b72Is this GitHub pull request spam, AI-generated slop, or low quality?

Tff7b72Title: ${{ env.PR_TITLE }}
Tff7b72Body: ${{ env.PR_BODY }}

Tff7b72Respond with exactly one of: spam, ai-generated, needs-review, ok
Tff7b72system-promptTb4b4b4: Ta5d6ffYouTa5d6ff Ta5d6ffdetectTa5d6ff Ta5d6ffspamTa5d6ff Ta5d6ffandTa5d6ff Ta5d6fflow-qualityTa5d6ff Ta5d6ffcontributions.Ta5d6ff Ta5d6ffBeTa5d6ff Ta5d6ffconservativeTa5d6ff Ta5d6ff-Ta5d6ff Ta5d6ffonlyTa5d6ff Ta5d6ffflagTa5d6ff Ta5d6ffobviousTa5d6ff Ta5d6ffspamTa5d6ff Ta5d6fforTa5d6ff Ta5d6ffAITa5d6ff Ta5d6ffslop.
Tff7b72modelTb4b4b4: Ta5d6ffopenai/gpt-4o-mini

Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffApplyTa5d6ff Ta5d6ffqualityTa5d6ff Ta5d6fflabelTa5d6ff Ta5d6ffifTa5d6ff Ta5d6ffneeded
Tff7b72ifTb4b4b4: Ta5d6ffsteps.check-labels.outputs.skip_allTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'true'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ffsteps.quality.outputs.responseTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff''Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ffsteps.quality.outputs.responseTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'ok'
Tff7b72usesTb4b4b4: Ta5d6ffactions/github-script@v9
Tff7b72idTb4b4b4: Ta5d6ffquality-label
Tff7b72envTb4b4b4:
Tff7b72QUALITY_LABELTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffsteps.quality.outputs.responseTa5d6ff Ta5d6ff}}
Tff7b72withTb4b4b4:
Tff7b72scriptTb4b4b4: Tb4b4b4|
Tff7b72const label = (process.env.QUALITY_LABEL || '').trim().toLowerCase();
Tff7b72const labelMeta = {
Tff7b72'spam': { color: 'd73a4a', description: 'Possible spam' },
Tff7b72'ai-generated': { color: 'fbca04', description: 'Possible AI-generated low-quality content' },
Tff7b72'needs-review': { color: 'f9d0c4', description: 'Needs human review' },
Tff7b72};
Tff7b72const meta = labelMeta[label];
Tff7b72if (!meta) return;

Tff7b72// Ensure label exists
Tff7b72try {
Tff7b72await github.rest.issues.getLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label });
Tff7b72} catch (e) {
Tff7b72if (e.status !== 404) throw e;
Tff7b72await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: meta.color, description: meta.description });
Tff7b72}

Tff7b72// Apply label
Tff7b72await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, labels: [label] });

Tff7b72core.setOutput('is_spam', 'true');

T8b949e# ─────────────────────────────────────────────────────────────────────────
T8b949e# Step 3: Auto-label PR type (bugfix/enhancement/refactor)
T8b949e# ─────────────────────────────────────────────────────────────────────────
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffClassifyTa5d6ff Ta5d6ffPRTa5d6ff Ta5d6ffforTa5d6ff Ta5d6fflabeling
Tff7b72ifTb4b4b4: Ta5d6ffsteps.check-labels.outputs.skip_allTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'true'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ffsteps.check-labels.outputs.has_type_labelTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'true'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ff(steps.quality.outputs.responseTa5d6ff Ta5d6ff==Ta5d6ff Ta5d6ff'ok'Ta5d6ff Ta5d6ff||Ta5d6ff Ta5d6ffsteps.quality.outputs.responseTa5d6ff Ta5d6ff==Ta5d6ff Ta5d6ff'')
Tff7b72usesTb4b4b4: Ta5d6ffactions/ai-inference@v2
Tff7b72idTb4b4b4: Ta5d6ffclassify
Tff7b72continue-on-errorTb4b4b4: Ta5d6fftrue
Tff7b72envTb4b4b4:
Tff7b72PR_TITLETb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.event.pull_request.titleTa5d6ff Ta5d6ff}}
Tff7b72PR_BODYTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.event.pull_request.bodyTa5d6ff Ta5d6ff}}
Tff7b72withTb4b4b4:
Tff7b72max-tokensTb4b4b4: Ta5d6ff30
Tff7b72promptTb4b4b4: Tb4b4b4|
Tff7b72Classify this pull request for the Meshtastic Android app into exactly one category.

Tff7b72Return exactly one of: bugfix, enhancement, refactor, chore, ci, build, testing, documentation

Tff7b72Label definitions:
Tff7b72- bugfix: Fixes a bug, crash, or incorrect behavior
Tff7b72- enhancement: Adds a new feature, improves UX, adds new functionality, or improves performance
Tff7b72- refactor: Restructures code without changing behavior, cleans up code, or improves architecture
Tff7b72- chore: Routine maintenance (dependency updates, config tweaks, version bumps) that doesn't change app behavior
Tff7b72- ci: Changes to CI/CD workflows, GitHub Actions, or automation scripts
Tff7b72- build: Changes to build system, Gradle config, build-logic, or compilation settings
Tff7b72- testing: Adds or modifies tests without changing production code
Tff7b72- documentation: Documentation-only changes (README, CHANGELOG, code comments, KDoc)

Tff7b72Title: ${{ env.PR_TITLE }}
Tff7b72Body: ${{ env.PR_BODY }}
Tff7b72system-promptTb4b4b4: Tb4b4b4>
Tff7b72You classify pull requests into categories for changelog generation.
Tff7b72Pick the single most specific label. Prefer ci/build/chore/testing/documentation
Tff7b72over refactor when the change clearly fits those narrower categories.
Tff7b72Only use bugfix for actual bug fixes, not for CI fixes or build fixes.
Tff7b72Only use enhancement for user-facing features, not for internal improvements.
Tff7b72modelTb4b4b4: Ta5d6ffopenai/gpt-4o-mini

Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffApplyTa5d6ff Ta5d6fftypeTa5d6ff Ta5d6fflabel
Tff7b72ifTb4b4b4: Ta5d6ffsteps.check-labels.outputs.skip_allTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'true'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ffsteps.check-labels.outputs.has_type_labelTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff'true'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ffsteps.classify.outputs.responseTa5d6ff Ta5d6ff!=Ta5d6ff Ta5d6ff''
Tff7b72usesTb4b4b4: Ta5d6ffactions/github-script@v9
Tff7b72envTb4b4b4:
Tff7b72TYPE_LABELTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffsteps.classify.outputs.responseTa5d6ff Ta5d6ff}}
Tff7b72withTb4b4b4:
Tff7b72scriptTb4b4b4: Tb4b4b4|
Tff7b72const label = (process.env.TYPE_LABEL || '').trim().toLowerCase();
Tff7b72const labelMeta = {
Tff7b72'bugfix': { color: 'd73a4a', description: 'Bug fix' },
Tff7b72'enhancement': { color: 'a2eeef', description: 'New feature or enhancement' },
Tff7b72'refactor': { color: 'c5def5', description: 'Code restructuring without behavior change' },
Tff7b72'chore': { color: 'ededed', description: 'Routine maintenance' },
Tff7b72'ci': { color: 'bfd4f2', description: 'CI/CD and automation changes' },
Tff7b72'build': { color: 'bfd4f2', description: 'Build system changes' },
Tff7b72'testing': { color: 'f9d0c4', description: 'Test additions or modifications' },
Tff7b72'documentation': { color: '0075ca', description: 'Documentation changes' },
Tff7b72};
Tff7b72const meta = labelMeta[label];
Tff7b72if (!meta) return;

Tff7b72// Ensure label exists
Tff7b72try {
Tff7b72await github.rest.issues.getLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label });
Tff7b72} catch (e) {
Tff7b72if (e.status !== 404) throw e;
Tff7b72await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: meta.color, description: meta.description });
Tff7b72}

Tff7b72// Apply label
Tff7b72await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, labels: [label] });

Served by rngit 1.5.2 - Generated in 0.07s